example 1:
========
// This program demonstrates the increment and decrement
// operators.

#include <iostream.h>
#include <conio.h>
void main(void)
{
clrscr();
	int bigVal = 10, smallVal = 1;

	cout << "bigVal is " << bigVal 
	     << " and smallVal is " << smallVal << "\n";
	smallVal++;
	bigVal--;
cout << "bigVal is " << bigVal 
	     << " and smallVal is " << smallVal << "\n";
	++smallVal;
	--bigVal;
	cout << "bigVal is " << bigVal 
	     << " and smallVal is " << smallVal << "\n";
getch();

}


example 2:

=============
#include <iostream.h>
#include <conio.h>
void main(void)
{
clrscr();

int a = 2,b = 5;
c = a * b++;

cout << a <<      << b <<      << c;
getch();

}



example 3:
=============

#include <iostream.h>
#include <conio.h>
void main(void)
{
clrscr();

int x = 10;
if ( x++ > 10)
cout << x is greater than 10.\n;
getch();

}


example 4:
=============

// This program demonstrates a simple while loop.
#include <iostream.h>
#include <conio.h>

void main(void)
{
clrscr();
	int number = 0;

	cout << "This program will let you enter number after\n";
	cout << "number. Enter 99 when you want to quit the ";
	cout << "program.\n";

	while (number != 99)
		cin >> number;
getch();
}



example 5:
=============

#include <iostream.h>
#include <conio.h>

void main(void)
{
clrscr();
int test = 0;
while (test < 10)
    cout << Hello\n;
getch();
}


example 6:
=============

// This program displays the numbers 1 through 10 and 
// their squares.
#include <iostream.h>
#include <conio.h>
void main(void)
{
clrscr();
	int num = 1;      // Initialize counter

	cout << "number     number Squared\n";
	cout << "-------------------------\n";
	while (num <= 10)
	{
		cout << num << "\t\t" << (num * num) << "\n";
		num++;       // Increment counter
	}
getch();	
}


example 7:
=============

// This program displays the numbers 1 through 10 and 
// their squares.

#include <iostream.h> 
#include <conio.h>

void main(void)
{
clrscr();
	int num = 0;
	cout << "number     number Squared\n";
	cout << "-------------------------\n";
	while (num++ < 10)
		cout << num << "\t\t" << (num * num) << "\n";
getch();
}



example 8:
=============

// This program averages a set of test scores for multiple
// students. It lets the user decide how many.
#include <iostream.h>
#include <conio.h>
void main(void)
{
clrscr();
	int numStudents, count = 0;

	cout << "This program will give you the average of three\n";
	cout << "test scores per student.\n";
	cout << "How many students do you have test scores for? ";
	cin >> numStudents;
	cout << "Enter the scores for each of the students.\n";
	
	
while (count++ < numStudents)
	{
		int score1, score2, score3;
		float average;
		cout << "\nStudent " << count << ": ";
		cin >> score1 >> score2 >> score3;
		average = (score1 + score2 + score3) / 3.0;
		cout << "The average is " << average << ".\n";
	}
getch();
 }
